﻿using System;
using Ewk.Math.Algebra.UnitTests.MatrixTests.NumericTests;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Ewk.Math.Algebra.UnitTests.MatrixTests.Int32Tests
{
    [TestClass]
    public class SubtractTests : SubtractTestBase<int>
    {
        [TestMethod, ExpectedException(typeof(InvalidOperationException))]
        public void Subtract_throws_an_InvalidOperationException_when_the_dimensions_are_not_equal()
        {
            const int m = 3;
            var matrix1 = Matrix;
            var matrix2 = CreateMatrix(m - 1, m, (i, j) => (i + 1) * (j + 1));

            matrix1.Subtract(matrix2);
        }

        protected override Matrix<int> Matrix
        {
            get
            {
                return CreateMatrix(RowCount, ColumnCount, (i, j) => (i + 1) * (j + 1));
            }
        }
    }
}